//
// #001012 编写一个程序，以每行一个单词的形式打印其输入
//
// Created by DongPan on 7/22/2022.
//
#include <stdio.h>

#define IN 1 /*inside a word */
#define OUT 0  /*outside a word*/

int main(void)
{
    int c, state;
    state = OUT;

    while ((c = getchar()) != EOF) {
        if (c == ' ' || c == '\n' || c == '\t') {
            if (state == IN) {
                putchar('\n');
                state = OUT;
            }
        } else {
            if (state == IN) {
                putchar(c);
            } else {
                state = IN;
                putchar(c);
            }
        }
    }

    return 0;
}